Nested table

In Stage 1, if you include a field in your Page View that is a nested table (that is a single field with more than one value, Other Names: (Person Details) for example), it is necessary to include a simple loop when configuring the stylesheet at Stage 2.

When you add a nested table field to the Report Properties box (at Step 6), it displays with the following icon Nested table icon:

Nested table

The loop is defined with the xsl:for-each element.

  1. When all the fields for the Page View are added to the Report Properties box (above) click OK to close the box.

    The new Page View report is added to the Reports box.

  2. Select the report in the Reports box and run it (click Report to report on the current record only).

    A box displays with the following message:

    Start new report

  3. Click Yes.

    An xml file (xmldata.xml) is generated by EMu and saved to the default Windows temp directory for whoever is currently logged on to the computer (in Windows XP this is usually: C:\Documents and Settings\user\Local Settings\Temp where user is the name of the currently logged on user).

    If your PC has been configured to open xml files with an editor, the editor will open and display the xmldata.xml file.

    Note: Your PC's xml viewer / editor opens when you click Yes . By default this is Internet Explorer, and you will probably want to change this via the Tools>Folder Options box in Windows Explorer.

    Nested Example

  4. Again we must map the hierarchical path to each atom. The loop is specified using the xsl:for-each element:
    <html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict">
    	<title>Parties Page View</title>
    	<body>
    		<b>Given Name: </b> <xsl:value-of select="/table/tuple/atom[@name='NamFirst']"/><br/>
    		<b>Surname: </b> <xsl:value-of select="/table/tuple/atom[@name='NamLast']"/><br/>
    		<xsl:for-each select="/table/tuple/table/tuple"><b>Other Names : </b> 
    			<xsl:value-of select="atom[@name='NamOtherNames']"/><br/>
    		</xsl:for-each>
    	</body>
    </html>

    For loop

  5. Save the stylesheet and attach it to the Page View defined in EMu (as in Stage 3).

    Now when the Page View is selected (View>Page Settings>Choose Page), the Page View displays as:

    Output of nested loop